Optimal. Leaf size=124 \[ \frac {B (b c-a d)^2 g^2 n x}{3 d^2}-\frac {B (b c-a d) g^2 n (a+b x)^2}{6 b d}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {B (b c-a d)^3 g^2 n \log (c+d x)}{3 b d^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {2547, 21, 45}
\begin {gather*} \frac {g^2 (a+b x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b}-\frac {B g^2 n (b c-a d)^3 \log (c+d x)}{3 b d^3}+\frac {B g^2 n x (b c-a d)^2}{3 d^2}-\frac {B g^2 n (a+b x)^2 (b c-a d)}{6 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 45
Rule 2547
Rubi steps
\begin {align*} \int (a g+b g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {(B n) \int \frac {(b c-a d) g^3 (a+b x)^2}{c+d x} \, dx}{3 b g}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {\left (B (b c-a d) g^2 n\right ) \int \frac {(a+b x)^2}{c+d x} \, dx}{3 b}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {\left (B (b c-a d) g^2 n\right ) \int \left (-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}+\frac {(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx}{3 b}\\ &=\frac {B (b c-a d)^2 g^2 n x}{3 d^2}-\frac {B (b c-a d) g^2 n (a+b x)^2}{6 b d}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {B (b c-a d)^3 g^2 n \log (c+d x)}{3 b d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 103, normalized size = 0.83 \begin {gather*} \frac {g^2 \left ((a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+\frac {B (-b c+a d) n \left (d \left (a^2 d+4 a b d x+b^2 x (-2 c+d x)\right )+2 (b c-a d)^2 \log (c+d x)\right )}{2 d^3}\right )}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.05, size = 0, normalized size = 0.00 \[\int \left (b g x +a g \right )^{2} \left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 312 vs.
\(2 (117) = 234\).
time = 0.28, size = 312, normalized size = 2.52 \begin {gather*} \frac {1}{3} \, B b^{2} g^{2} x^{3} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {1}{3} \, A b^{2} g^{2} x^{3} + B a b g^{2} x^{2} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + A a b g^{2} x^{2} + \frac {1}{6} \, B b^{2} g^{2} n {\left (\frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} - B a b g^{2} n {\left (\frac {a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c - a d\right )} x}{b d}\right )} + B a^{2} g^{2} n {\left (\frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} + B a^{2} g^{2} x \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + A a^{2} g^{2} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 253 vs.
\(2 (117) = 234\).
time = 0.39, size = 253, normalized size = 2.04 \begin {gather*} \frac {2 \, {\left (A + B\right )} b^{3} d^{3} g^{2} x^{3} + 2 \, B a^{3} d^{3} g^{2} n \log \left (b x + a\right ) - 2 \, {\left (B b^{3} c^{3} - 3 \, B a b^{2} c^{2} d + 3 \, B a^{2} b c d^{2}\right )} g^{2} n \log \left (d x + c\right ) + {\left (6 \, {\left (A + B\right )} a b^{2} d^{3} g^{2} - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g^{2} n\right )} x^{2} + 2 \, {\left (3 \, {\left (A + B\right )} a^{2} b d^{3} g^{2} + {\left (B b^{3} c^{2} d - 3 \, B a b^{2} c d^{2} + 2 \, B a^{2} b d^{3}\right )} g^{2} n\right )} x + 2 \, {\left (B b^{3} d^{3} g^{2} n x^{3} + 3 \, B a b^{2} d^{3} g^{2} n x^{2} + 3 \, B a^{2} b d^{3} g^{2} n x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{6 \, b d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1836 vs.
\(2 (117) = 234\).
time = 4.59, size = 1836, normalized size = 14.81 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.28, size = 303, normalized size = 2.44 \begin {gather*} \ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (B\,a^2\,g^2\,x+B\,a\,b\,g^2\,x^2+\frac {B\,b^2\,g^2\,x^3}{3}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{3\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,d}\right )}{3\,b\,d}-\frac {a\,g^2\,\left (3\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b\,c\,g^2}{d}\right )+x^2\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{6\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,d}\right )-\frac {\ln \left (c+d\,x\right )\,\left (3\,B\,n\,a^2\,c\,d^2\,g^2-3\,B\,n\,a\,b\,c^2\,d\,g^2+B\,n\,b^2\,c^3\,g^2\right )}{3\,d^3}+\frac {A\,b^2\,g^2\,x^3}{3}+\frac {B\,a^3\,g^2\,n\,\ln \left (a+b\,x\right )}{3\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________